package method.io;


import java.io.FileOutputStream;
import java.io.IOException;

public class FileOutputStreamDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("D:\\project\\demo1\\TestDemo\\src\\method\\io\\Hello.txt",true);
        String s = "好好学习 天天向上！Java从入门到精通";
        byte[] b = s.getBytes();            //将字符串转换为字节数组
        fos.write(b,2,b.length-2);
     //   System.out.println("文件已更新");
        fos.close();
    }
}
